using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace sforceExplorer
{
	/// <summary>
	/// Summary description for frmAddScontrol.
	/// </summary>
	public class frmAddScontrol : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		public System.Windows.Forms.TextBox txtSControlName;
		private System.Windows.Forms.Label label2;
		public System.Windows.Forms.TextBox txtDescription;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		public System.Windows.Forms.TextBox txtFileName;
		private System.Windows.Forms.Button btnBrowse;
		private System.Windows.Forms.Button btnSave;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.OpenFileDialog ofd;
		public System.Windows.Forms.RichTextBox txtHTMLWrapper;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public frmAddScontrol()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.txtSControlName = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.txtDescription = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.txtFileName = new System.Windows.Forms.TextBox();
			this.btnBrowse = new System.Windows.Forms.Button();
			this.btnSave = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.ofd = new System.Windows.Forms.OpenFileDialog();
			this.txtHTMLWrapper = new System.Windows.Forms.RichTextBox();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(16, 12);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(88, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "S-Control Name:";
			// 
			// txtSControlName
			// 
			this.txtSControlName.Location = new System.Drawing.Point(112, 8);
			this.txtSControlName.MaxLength = 80;
			this.txtSControlName.Name = "txtSControlName";
			this.txtSControlName.Size = new System.Drawing.Size(416, 20);
			this.txtSControlName.TabIndex = 1;
			this.txtSControlName.Text = "";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(16, 44);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(88, 16);
			this.label2.TabIndex = 0;
			this.label2.Text = "Description:";
			// 
			// txtDescription
			// 
			this.txtDescription.Location = new System.Drawing.Point(112, 40);
			this.txtDescription.MaxLength = 255;
			this.txtDescription.Multiline = true;
			this.txtDescription.Name = "txtDescription";
			this.txtDescription.Size = new System.Drawing.Size(560, 64);
			this.txtDescription.TabIndex = 2;
			this.txtDescription.Text = "";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(16, 123);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(88, 16);
			this.label3.TabIndex = 0;
			this.label3.Text = "HTML Wrapper:";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(16, 524);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(88, 16);
			this.label4.TabIndex = 0;
			this.label4.Text = "Support File:";
			// 
			// txtFileName
			// 
			this.txtFileName.Location = new System.Drawing.Point(112, 520);
			this.txtFileName.MaxLength = 255;
			this.txtFileName.Name = "txtFileName";
			this.txtFileName.Size = new System.Drawing.Size(328, 20);
			this.txtFileName.TabIndex = 1;
			this.txtFileName.Text = "";
			// 
			// btnBrowse
			// 
			this.btnBrowse.Location = new System.Drawing.Point(448, 520);
			this.btnBrowse.Name = "btnBrowse";
			this.btnBrowse.TabIndex = 4;
			this.btnBrowse.Text = "Browse";
			this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
			// 
			// btnSave
			// 
			this.btnSave.Location = new System.Drawing.Point(536, 520);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new System.Drawing.Size(64, 23);
			this.btnSave.TabIndex = 5;
			this.btnSave.Text = "Save";
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.Location = new System.Drawing.Point(608, 520);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(64, 23);
			this.btnCancel.TabIndex = 5;
			this.btnCancel.Text = "Cancel";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// txtHTMLWrapper
			// 
			this.txtHTMLWrapper.Location = new System.Drawing.Point(112, 120);
			this.txtHTMLWrapper.MaxLength = 1048576;
			this.txtHTMLWrapper.Name = "txtHTMLWrapper";
			this.txtHTMLWrapper.Size = new System.Drawing.Size(560, 384);
			this.txtHTMLWrapper.TabIndex = 6;
			this.txtHTMLWrapper.Text = "";
			// 
			// frmAddScontrol
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(696, 573);
			this.Controls.Add(this.txtHTMLWrapper);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.btnBrowse);
			this.Controls.Add(this.txtDescription);
			this.Controls.Add(this.txtSControlName);
			this.Controls.Add(this.txtFileName);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.btnCancel);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "frmAddScontrol";
			this.Text = "New S-Control";
			this.ResumeLayout(false);

		}
		#endregion

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.Hide();
		}

		private void btnBrowse_Click(object sender, System.EventArgs e)
		{
			if (ofd.ShowDialog(this).Equals(System.Windows.Forms.DialogResult.OK)) 
			{
				this.txtFileName.Text = ofd.FileName;
			}
		}

		private void btnSave_Click(object sender, System.EventArgs e)
		{
			this.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.Hide();
		}
	}
}
